@effectai/sdk
Advanced tools
Comparing version 2.0.0 to 2.0.1
import type { Client } from "../../client"; | ||
export type UploadIpfsResourceArgs = { | ||
client: Client; | ||
data: Record<string, unknown>; | ||
data: Record<string, unknown> | Record<string, unknown>[]; | ||
}; | ||
export declare const uploadIpfsResource: ({ client, data, }: UploadIpfsResourceArgs) => Promise<string>; | ||
export declare const ipfsCIDToHex: (cid: string) => string; |
@@ -1,2 +0,2 @@ | ||
import { Bytes } from "@wharfkit/antelope"; | ||
import { Base58 } from "@wharfkit/antelope"; | ||
export const uploadIpfsResource = async ({ client, data, }) => { | ||
@@ -31,9 +31,4 @@ try { | ||
export const ipfsCIDToHex = (cid) => { | ||
const string = atob(cid); | ||
const array = new Uint8Array(string.length); | ||
for (let i = 0; i < string.length; i++) { | ||
array[i] = string.charCodeAt(i); | ||
} | ||
return Bytes.from(array).hexString; | ||
return Base58.decode(cid).hexString; | ||
}; | ||
//# sourceMappingURL=uploadIpfsResource.js.map |
@@ -22,4 +22,4 @@ import { type AnyAction } from "@wharfkit/antelope"; | ||
reward: number; | ||
taskData: Record<string, unknown>; | ||
taskData: Record<string, unknown>[]; | ||
}; | ||
export declare const createBatch: ({ client, campaignId, repetitions, reward, taskData, }: CreateBatchArgs) => Promise<import("@wharfkit/session").TransactResult>; |
@@ -15,5 +15,5 @@ import type { AnyAction } from "@wharfkit/antelope"; | ||
maxTaskTime: number; | ||
qualitications?: Quali[]; | ||
qualifications?: Quali[]; | ||
}; | ||
}; | ||
export declare const createCampaign: ({ client, campaign, }: CreateCampaignArgs) => Promise<import("@wharfkit/session").TransactResult>; |
@@ -42,3 +42,3 @@ import { SessionNotFoundError } from "../../../errors"; | ||
content: { field_0: 0, field_1: hash }, | ||
qualis: campaign.qualitications ?? [], | ||
qualis: campaign.qualifications ?? [], | ||
owner: ["name", client.session.actor.toString()], | ||
@@ -45,0 +45,0 @@ }, |
@@ -12,4 +12,4 @@ import { UInt128 } from "@wharfkit/antelope"; | ||
instructions: string; | ||
input_schema: null; | ||
output_schema: null; | ||
input_schema: string | null; | ||
output_schema: string | null; | ||
template: string; | ||
@@ -16,0 +16,0 @@ title: string; |
@@ -7,2 +7,6 @@ import type { Asset, NameType } from "@wharfkit/session"; | ||
}; | ||
export declare const getBalance: ({ client, actor, }: GetBalanceArgs) => Promise<Asset>; | ||
export declare const getBalance: ({ client, actor, }: GetBalanceArgs) => Promise<{ | ||
efxBalance: Asset; | ||
usdtBalance: Asset; | ||
eosBalance: Asset; | ||
}>; |
export const getBalance = async ({ client, actor, }) => { | ||
const { network, provider } = client; | ||
const { contracts } = network.config.efx; | ||
const [balance] = await provider.v1.chain.get_currency_balance(contracts.token, actor); | ||
if (!balance) { | ||
throw new Error("No balance found"); | ||
const [efxBalance] = await provider.v1.chain.get_currency_balance(contracts.token, actor); | ||
const [usdtBalance] = await provider.v1.chain.get_currency_balance(contracts.usdt, actor); | ||
const [eosBalance] = await provider.v1.chain.get_currency_balance(contracts.eostoken, actor); | ||
if (!efxBalance && !usdtBalance && !eosBalance) { | ||
throw new Error("No efxBalance found"); | ||
} | ||
return balance; | ||
return { | ||
efxBalance, | ||
usdtBalance, | ||
eosBalance, | ||
}; | ||
}; | ||
//# sourceMappingURL=getBalance.js.map |
@@ -32,2 +32,2 @@ import { APIClient, FetchProvider, type FetchProviderOptions } from "@wharfkit/antelope"; | ||
}); | ||
export declare const createClient: ({ network, session, options, }: CreateClientArgs) => Client; | ||
export declare const createClient: ({ network, session, options, }: CreateClientArgs) => Promise<Client>; |
@@ -54,3 +54,3 @@ import { APIClient, FetchProvider, } from "@wharfkit/antelope"; | ||
} | ||
export const createClient = ({ network, session, options = {}, }) => { | ||
export const createClient = async ({ network, session, options = {}, }) => { | ||
if (!network && !session) { | ||
@@ -67,3 +67,3 @@ throw new Error("Network or Session configuration is required to create a client."); | ||
// automatically set the session whenever the session is provided | ||
client.setSession(session); | ||
await client.setSession(session); | ||
return client; | ||
@@ -70,0 +70,0 @@ } |
@@ -15,2 +15,4 @@ import { defaultNetworkConfig } from "./config"; | ||
token: "efxtoken1112", | ||
usdt: "tethertether", | ||
eostoken: "eosio.token", | ||
stake: "efxstake1111", | ||
@@ -38,4 +40,6 @@ feepool: "efxfeepool11", | ||
contracts: { | ||
tasks: "force.efx", | ||
tasks: "tasks.efx", | ||
token: "effecttokens", | ||
usdt: "tethertether", | ||
eostoken: "eosio.token", | ||
stake: "efxstakepool", | ||
@@ -42,0 +46,0 @@ feepool: "feepool.efx", |
@@ -18,2 +18,4 @@ import type { ChainDefinitionType } from "@wharfkit/session"; | ||
token: string; | ||
usdt: string; | ||
eostoken: string; | ||
stake: string; | ||
@@ -20,0 +22,0 @@ feepool: string; |
@@ -5,2 +5,4 @@ import type { Client } from "../client"; | ||
token: string; | ||
usdt: string; | ||
eostoken: string; | ||
stake: string; | ||
@@ -7,0 +9,0 @@ feepool: string; |
{ | ||
"name": "@effectai/sdk", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Effect Network Javscript/Typescript SDK (for [https://effect.network](https://effect.network))", | ||
@@ -9,5 +9,3 @@ "main": "./dist/exports/index.js", | ||
"types": "./dist/exports/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"files": ["dist"], | ||
"type": "module", | ||
@@ -18,8 +16,3 @@ "repository": { | ||
}, | ||
"keywords": [ | ||
"efx", | ||
"AI", | ||
"blockchain", | ||
"microtasks" | ||
], | ||
"keywords": ["efx", "AI", "blockchain", "microtasks"], | ||
"author": { | ||
@@ -26,0 +19,0 @@ "name": "Effect-AI", |
@@ -1,6 +0,6 @@ | ||
# 🔥 @effectai/effect-js | ||
# 🔥 The @effectai/sdk Monorepo | ||
<p align="center"><img src="https://effect.network/img/logo/logo.png" width="400px"></p> | ||
Effect-js is a free and open-source library powered by blockchain technology that enables developers to collect and enrich their data-sets in a transparent way. | ||
The @effectai/sdk is a free and open source library for training next-gen transparent AI models. Integrate the SDK into your app and tap into a global, decentralized workforce powered by blockchain technology. | ||
@@ -7,0 +7,0 @@ ## 🗒️ Documentation |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218154
3772
2