diff --git a/.env.example b/.env.example index 7a15b619..69c3bb9d 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ RPC_URL=https://testnet.ixo.earth/rpc/ #https://impacthub-rpc.lavenderfive.com/ #http://localhost:26658/ # NEVER COMMIT MAINNET MNENOMICS!! Please be careful. TESTER_MNEMONIC-"mango tattoo civil foam frog wheat venue rebuild cloth example alien taste" +ED_KEYS_MNEMONIC="office dance method praise twenty flush bacon stereo claw music what satisfy" IBC_FROM_MNEMONIC="mango tattoo civil foam frog wheat venue rebuild cloth example alien taste" IBC_TO_ADDRESS=ixo1tumrhpa5tpegdcs2nhwzft8maprttz66pvntc9 diff --git a/__tests__/flows/claims.ts b/__tests__/flows/claims.ts index 1717c075..36f84ac5 100644 --- a/__tests__/flows/claims.ts +++ b/__tests__/flows/claims.ts @@ -13,6 +13,7 @@ export const claimsBasic = () => const res = await Entity.CreateEntity( "protocol", undefined, + "", WalletUsers.charlie ); protocol = utils.common.getValueFromEvents(res, "wasm", "token_id"); @@ -130,6 +131,7 @@ export const devnetClaims = () => const res = await Entity.CreateEntity( "protocol", undefined, + "", WalletUsers.charlie ); protocol = utils.common.getValueFromEvents(res, "wasm", "token_id"); diff --git a/__tests__/flows/cosmos.ts b/__tests__/flows/cosmos.ts index 5723fe64..5118ca8e 100644 --- a/__tests__/flows/cosmos.ts +++ b/__tests__/flows/cosmos.ts @@ -57,6 +57,6 @@ export const sendTokens = () => }); export const govDeposit = () => - describe("/cosmos.gov.v1beta1.MsgDeposit", () => { - testMsg("/cosmos.bank.v1beta1.MsgSend", () => Cosmos.MsgDeposit(404)); + describe("Testing deposit funds into proposals", () => { + testMsg("/cosmos.bank.v1beta1.MsgDeposit", () => Cosmos.MsgDeposit(434)); }); diff --git a/__tests__/flows/entities.ts b/__tests__/flows/entities.ts index 2502bef6..80a35a4a 100644 --- a/__tests__/flows/entities.ts +++ b/__tests__/flows/entities.ts @@ -163,68 +163,68 @@ export const supamotoEntities = () => }); // Save supamoto creator CELLNODE emerging cellnode - // let creator = "4kavdefz12wlefltwxr"; - // test("Saving creator", async () => { - // const tester = getUser(); - // const file = JSON.parse( - // getFileFromPath(["documents", "test-supamoto-creator.jsonld"], "ascii") - // ); - // file["issuer"] = tester.did; - // file["credentialSubject"]["id"] = daoCredsIssuerDid; - // file["credentialSubject"]["logo"] = ecsLogo; - // let buff = Buffer.from(JSON.stringify(file)); - // creator = ( - // await customQueries.cellnode.uploadPublicDoc( - // "application/ld+json", - // buff.toString("base64"), - // undefined, - // cellNodeNetwork - // ) - // ).key; - // console.log({ creator }); - // expect(creator).toBeTruthy(); - // }); + let creator = "4kavdefz12wlefltwxr"; + test("Saving creator", async () => { + const tester = getUser(); + const file = JSON.parse( + getFileFromPath(["documents", "test-supamoto-creator.jsonld"], "ascii") + ); + file["issuer"] = tester.did; + file["credentialSubject"]["id"] = daoCredsIssuerDid; + file["credentialSubject"]["logo"] = ecsLogo; + let buff = Buffer.from(JSON.stringify(file)); + creator = ( + await customQueries.cellnode.uploadPublicDoc( + "application/ld+json", + buff.toString("base64"), + undefined, + cellNodeNetwork + ) + ).key; + console.log({ creator }); + expect(creator).toBeTruthy(); + }); // Save supamoto administrator CELLNODE - // let administrator = "gm7528l8xd4lefltxcz"; - // test("Saving administrator", async () => { - // const tester = getUser(); - // const file = JSON.parse( - // getFileFromPath( - // ["documents", "test-supamoto-administrator.jsonld"], - // "ascii" - // ) - // ); - // file["issuer"] = tester.did; - // file["credentialSubject"]["id"] = daoCredsIssuerDid; - // file["credentialSubject"]["logo"] = ecsLogo; - // let buff = Buffer.from(JSON.stringify(file)); - // administrator = ( - // await customQueries.cellnode.uploadPublicDoc( - // "application/ld+json", - // buff.toString("base64"), - // undefined, - // cellNodeNetwork - // ) - // ).key; - // console.log({ administrator }); - // expect(administrator).toBeTruthy(); - // }); + let administrator = "gm7528l8xd4lefltxcz"; + test("Saving administrator", async () => { + const tester = getUser(); + const file = JSON.parse( + getFileFromPath( + ["documents", "test-supamoto-administrator.jsonld"], + "ascii" + ) + ); + file["issuer"] = tester.did; + file["credentialSubject"]["id"] = daoCredsIssuerDid; + file["credentialSubject"]["logo"] = ecsLogo; + let buff = Buffer.from(JSON.stringify(file)); + administrator = ( + await customQueries.cellnode.uploadPublicDoc( + "application/ld+json", + buff.toString("base64"), + undefined, + cellNodeNetwork + ) + ).key; + console.log({ administrator }); + expect(administrator).toBeTruthy(); + }); // Save supamoto page CELLNODE - // let page = "zh211j0pb0llefltxre"; - // test("Saving page", async () => { - // page = ( - // await customQueries.cellnode.uploadPublicDoc( - // "application/json", - // getFileFromPath(["documents", "test-supamoto-page.json"]), - // undefined, - // cellNodeNetwork - // ) - // ).key; - // console.log({ page }); - // expect(page).toBeTruthy(); - // }); + let page = "zh211j0pb0llefltxre"; + test("Saving page", async () => { + page = ( + await customQueries.cellnode.uploadPublicDoc( + "application/json", + getFileFromPath(["documents", "test-supamoto-page.json"]), + undefined, + cellNodeNetwork + ) + ).key; + console.log({ page }); + expect(page).toBeTruthy(); + }); // Save supamoto projectCreds WEB3 let projectCreds = @@ -299,7 +299,6 @@ export const supamotoEntities = () => expect(tokenMetadata).toBeTruthy(); }); - // TODO need protocol to add as template id // Save supamoto claims CELLNODE let claims = "gf9m2u5ds6tleflu4a8"; test("Saving claims", async () => { @@ -315,11 +314,10 @@ export const supamotoEntities = () => expect(claims).toBeTruthy(); }); - // TODO cookstove-asset-protocol // Create a base Protocol entity let protocolDid = "did:ixo:entity:065ba0b99948e2e8ff3228836dee423b"; testMsg("/ixo.entity.v1beta1.MsgCreateEntity protocol", async () => { - const res = await Entity.CreateEntity("protocol"); + const res = await Entity.CreateEntity("protocol/asset"); protocolDid = utils.common.getValueFromEvents(res, "wasm", "token_id"); console.log({ protocolDid }); return res; @@ -338,7 +336,7 @@ export const supamotoEntities = () => claims, tokenMetadata, projectCert: projectCreds, - oracle: daoCredsIssuerDid, + oracles: [daoCredsIssuerDid], }); protocolAssetDid = utils.common.getValueFromEvents( res, diff --git a/__tests__/flows/iids.ts b/__tests__/flows/iids.ts index d1348c3c..44857d4d 100644 --- a/__tests__/flows/iids.ts +++ b/__tests__/flows/iids.ts @@ -38,14 +38,6 @@ export const registerIids = () => Iid.CreateIidDoc(user) ); }); - - // testQry( - // "test query", - // () => queryClient.ixo.bonds.v1beta1.bond({ bondDid: "adsf" }), - // { - // bonds: [], - // } - // ); }); // ------------------------------------------------------------ @@ -107,6 +99,14 @@ export const iidsBasic = () => testMsg("/ixo.iid.v1beta1.MsgDeleteService", () => Iid.DeleteService()); }); +export const iidAddEdKeys = () => + describe("Testing the Iid module adding ED keys to iid doc", () => { + testMsg("/ixo.iid.v1beta1.MsgAddVerification", () => Iid.AddVerification()); + // testMsg("/ixo.iid.v1beta1.MsgRevokeVerification", () => + // Iid.RevokeVerification() + // ); + }); + export const generateBlockchainTestUsers = () => { beforeAll(() => generateNewWallet( diff --git a/__tests__/flows/quickQueries.ts b/__tests__/flows/quickQueries.ts index 73f4d79c..f52add05 100644 --- a/__tests__/flows/quickQueries.ts +++ b/__tests__/flows/quickQueries.ts @@ -7,11 +7,29 @@ export const quickQueries = () => describe("Quick queries to see states", () => { test("Quick queries to see states filler", () => expect(true).toBeTruthy()); - // test("Query cosmos.tx.v1beta1.getBlockWithTxs", async () => { - // const res = await queryClient.cosmos.tx.v1beta1.getTx({ - // hash: "C35404333376CD5FC1AFD57903061394F0333CF6B8047E9A693E0E59350AE695", + // test("Query ixo.bonds.v1beta1", async () => { + // const res = await queryClient.ixo.bonds.v1beta1.bondsDetailed(); + // console.log(res.bondsDetailed); + // expect(res).toBeTruthy(); + // }); + + // test("Query cosmos.tx.v1beta1.getTxsEvent", async () => { + // const res = await queryClient.cosmos.tx.v1beta1.getTxsEvent({ + // events: [`tx.height=${15955}`], + // orderBy: 1, // }); - // console.log(res.txResponse?.events); + // // console.log(res); + // console.log(res.txResponses[0]); + // console.log(createRegistry().decode(res.txResponses[0].tx!)); + // expect(res).toBeTruthy(); + // }); + + // test("Query cosmos.tx.v1beta1.getBlockByHeight", async () => { + // const res = + // await queryClient.cosmos.base.tendermint.v1beta1.getBlockByHeight({ + // height: Long.fromNumber(15955), + // }); + // console.log(res); // expect(res).toBeTruthy(); // }); @@ -68,12 +86,6 @@ export const quickQueries = () => // expect(res).toBeTruthy(); // }); - // test("query wasm store codes", async () => { - // const res = await queryClient.cosmwasm.wasm.v1.codes(); - // console.log(res.codeInfos); - // expect(res).toBeTruthy(); - // }); - // test("query tokens list by did", async () => { // const user = (await getUser(WalletUsers.tester).getAccounts())[0].address; // const res = await queryClient.ixo.token.v1beta1.tokenList({ diff --git a/__tests__/index.spec.ts b/__tests__/index.spec.ts index 5b6dd8fd..5a8bbbd4 100644 --- a/__tests__/index.spec.ts +++ b/__tests__/index.spec.ts @@ -12,6 +12,7 @@ import { registerIids, registerIidsDev, generateBlockchainTestUsers, + iidAddEdKeys, } from "./flows/iids"; import { enititiesBasic, supamotoEntities } from "./flows/entities"; import { ibcBasic } from "./flows/ibc"; @@ -37,6 +38,7 @@ generateBlockchainTestUsers(); // registerIids(); // instantiateModulesProposals(); // iidsBasic(); +// iidAddEdKeys(); // bondsBasic(); // bondsSellsDisabled(); // bondsSellsEnabled(); diff --git a/__tests__/modules/Cosmos.ts b/__tests__/modules/Cosmos.ts index 4fe40b9d..61dacd5e 100644 --- a/__tests__/modules/Cosmos.ts +++ b/__tests__/modules/Cosmos.ts @@ -76,7 +76,7 @@ export const MsgSubmitProposalStoreCW = async ( value: cosmwasm.wasm.v1.StoreCodeProposal.encode( cosmwasm.wasm.v1.StoreCodeProposal.fromPartial({ title: `Upload ${contract} smart contract`, - description: "Description", + description: "A cosmwasm smart contract", runAs: myAddress, wasmByteCode: new Uint8Array( getFileFromPath( diff --git a/__tests__/modules/Entity.ts b/__tests__/modules/Entity.ts index d3729ff9..20aa7d5e 100644 --- a/__tests__/modules/Entity.ts +++ b/__tests__/modules/Entity.ts @@ -17,6 +17,7 @@ import { fee, keyType, WalletUsers } from "../helpers/constants"; export const CreateEntity = async ( entityType: string = "asset", context?: [{ key: string; val: string }], + relayerNodeDid = "", relayerNode: WalletUsers = WalletUsers.tester, signer: WalletUsers = WalletUsers.tester ) => { @@ -28,7 +29,7 @@ export const CreateEntity = async ( const myPubKey = account.pubkey; const did = tester.did; - const relayerNodeDid = getUser(relayerNode).did; + const relayerNodeDidLocal = relayerNodeDid || getUser(relayerNode).did; const message = { typeUrl: "/ixo.entity.v1beta1.MsgCreateEntity", @@ -45,7 +46,7 @@ export const CreateEntity = async ( controller: [did], ownerDid: did, ownerAddress: myAddress, - relayerNode: relayerNodeDid, + relayerNode: relayerNodeDidLocal, }), }; @@ -63,7 +64,8 @@ type CreateEntityAssetSupamotoParams = { claims: string; tokenMetadata: string; projectCert: string; - oracle: string; + oracles: string[]; + relayerDid?: string; }; export const CreateEntityAssetSupamoto = async ( p: CreateEntityAssetSupamotoParams @@ -85,7 +87,6 @@ export const CreateEntityAssetSupamoto = async ( entityStatus: 0, controller: [did], context: createAgentIidContext([ - // cookstove-asset-protocol { key: "class", val: p.inheritEntityDid }, ]), verification: createIidVerificationMethods({ @@ -108,16 +109,9 @@ export const CreateEntityAssetSupamoto = async ( "https://github.com/cosmos/chain-registry/blob/master/ixo/chain.json?rpc/", }), ixo.iid.v1beta1.Service.fromPartial({ - // TODO check reference from supamoto to emerging id: "{id}#emerging", type: "linkedDomains", - serviceEndpoint: "https://app.emerging.eco/collection/?id=", - }), - // TODO remove and check references - ixo.iid.v1beta1.Service.fromPartial({ - id: "{id}#dashboard", - type: "linkedDomains", - serviceEndpoint: "https://supamoto.jambo.earth/?id=", + serviceEndpoint: "https://app.emerging.eco", }), ixo.iid.v1beta1.Service.fromPartial({ id: "{id}#ipfs", @@ -211,17 +205,7 @@ export const CreateEntityAssetSupamoto = async ( type: "WebDashboard", description: "Collection Dashboard", mediaType: "application/html", - serviceEndpoint: "#dashboard-collection", - proof: "", - encrypted: "false", - right: "#apitoken", - }), - ixo.iid.v1beta1.LinkedResource.fromPartial({ - id: "{id}#asset-dashboard", - type: "WebDashboard", - description: "SupaMoto Dashboard", - mediaType: "application/html", - serviceEndpoint: "#dashboard-supamoto", + serviceEndpoint: "emerging", proof: "", encrypted: "false", right: "#apitoken", @@ -266,24 +250,17 @@ export const CreateEntityAssetSupamoto = async ( service: "ixo", }), ], - linkedEntity: [ - // TODO include prospect and scalnyx oracle dids + linkedEntity: p.oracles.map((o) => ixo.iid.v1beta1.LinkedEntity.fromPartial({ - id: p.oracle, + id: o, type: "oracle", relationship: "verifies", service: "ixo", - }), - // ixo.iid.v1beta1.LinkedEntity.fromPartial({ - // id: p.oracle, - // type: "oracle", - // relationship: "verifies", - // service: "ixo", - // }), - ], + }) + ), ownerDid: did, ownerAddress: myAddress, - relayerNode: did, + relayerNode: p.relayerDid || did, }), }; @@ -293,9 +270,10 @@ export const CreateEntityAssetSupamoto = async ( export const CreateEntityAssetSupamotoInstance = async ( inheritEntityDid: string, - deviceId: string, + deviceId: string | number, index: number, - deviceCreds: string + deviceCreds: string, + relayerDid?: string ) => { const client = await createClient(); @@ -308,7 +286,7 @@ export const CreateEntityAssetSupamotoInstance = async ( const message = { typeUrl: "/ixo.entity.v1beta1.MsgCreateEntity", value: ixo.entity.v1beta1.MsgCreateEntity.fromPartial({ - entityType: "asset", + entityType: "asset/device", entityStatus: 0, context: createAgentIidContext([{ key: "class", val: inheritEntityDid }]), controller: [did], @@ -337,21 +315,11 @@ export const CreateEntityAssetSupamotoInstance = async ( type: "WebDashboard", description: "SupaMoto Dashboard", mediaType: "application/html", - serviceEndpoint: `dashboard-supamoto:${deviceId}`, + serviceEndpoint: `emerging:/collection/?id=${deviceId}`, proof: "", encrypted: "false", right: "#apitoken", }), - // ixo.iid.v1beta1.LinkedResource.fromPartial({ - // id: "{id}#customer-credential", - // type: "VerifiableCredential", - // description: "Customer Credential", - // mediaType: "application/ld+json", - // serviceEndpoint: `cellnode:${cid}`, - // proof: "", - // encrypted: "false", - // right: "", - // }), ], accordedRight: [], linkedEntity: [ @@ -364,7 +332,7 @@ export const CreateEntityAssetSupamotoInstance = async ( ], ownerDid: did, ownerAddress: myAddress, - relayerNode: did, + relayerNode: relayerDid || did, }), }; diff --git a/__tests__/modules/Iid.ts b/__tests__/modules/Iid.ts index 7d7a0870..cf5bbe17 100644 --- a/__tests__/modules/Iid.ts +++ b/__tests__/modules/Iid.ts @@ -134,7 +134,7 @@ export const DeleteIidContext = async () => { * @param relationships list with values: 'authentication' | 'assertionMethod' | 'keyAgreement' | 'capabilityInvocation' | 'capabilityDelegation' */ export const AddVerification = async ( - relationships: string[] = ["authentication"] + relationships: string[] = ["authentication", "assertionMethod"] ) => { const client = await createClient(); @@ -143,8 +143,8 @@ export const AddVerification = async ( const myAddress = account.address; const did = tester.did; - const alice = getUser(WalletUsers.alice); - const aliceAccount = (await alice.getAccounts())[0]; + const accountEd = (await getUser(WalletUsers.tester, "ed").getAccounts())[0]; + const myPubkey = accountEd.pubkey; const message = { typeUrl: "/ixo.iid.v1beta1.MsgAddVerification", @@ -153,10 +153,10 @@ export const AddVerification = async ( verification: ixo.iid.v1beta1.Verification.fromPartial({ relationships: relationships, method: customMessages.iid.createVerificationMethod( - alice.did, - aliceAccount.pubkey, - alice.did, - keyType + did, + myPubkey, + did, + "ed" ), }), signer: myAddress, @@ -171,7 +171,7 @@ export const AddVerification = async ( * @param relationships list with values: 'authentication' | 'assertionMethod' | 'keyAgreement' | 'capabilityInvocation' | 'capabilityDelegation' */ export const SetVerificationRelationships = async ( - relationships: string[] = ["authentication"] + relationships: string[] = ["assertionMethod"] ) => { const client = await createClient(); diff --git a/__tests__/setup/Entity.ts b/__tests__/setup/Entity.ts index 6417950c..23f197cf 100644 --- a/__tests__/setup/Entity.ts +++ b/__tests__/setup/Entity.ts @@ -7,6 +7,7 @@ import { fee, keyType, WalletUsers } from "../helpers/constants"; import { SetupDaoConstantFields } from "./impacts/constants"; import { SetupClassConstants } from "./classes/constants"; import { LinkedResourcesUploaded } from "./constants"; +import base58 from "bs58"; export const CreateEntityBasic = async ( entity: SetupClassConstants["dao"], @@ -49,7 +50,8 @@ export const CreateEntityBasic = async ( export const CreateEntity = async ( entity: SetupDaoConstantFields["entity"], - linkedResourcesUploaded: LinkedResourcesUploaded + linkedResourcesUploaded: LinkedResourcesUploaded, + addEdKeys = false ) => { const client = await createClient(); @@ -78,6 +80,32 @@ export const CreateEntity = async ( ? createAgentIidContext() : createAgentIidContext([{ key: "class", val: entity.contextClass }]); + const verification = createIidVerificationMethods({ + did, + pubkey: myPubKey, + address: myAddress, + controller: did, + type: keyType, + }); + + // Add ed keys user to verification method for verification of credentials + if (addEdKeys) { + const edPubKey = (await getUser(WalletUsers.alice).getAccounts())[0].pubkey; + const pubkeyBase58 = base58.encode(edPubKey); + + verification.push( + ixo.iid.v1beta1.Verification.fromPartial({ + relationships: ["attestation"], + method: ixo.iid.v1beta1.VerificationMethod.fromPartial({ + id: did + "#" + pubkeyBase58, + type: "Ed25519VerificationKey2018", + publicKeyBase58: pubkeyBase58, + controller: "{id}", + }), + }) + ); + } + const message = { typeUrl: "/ixo.entity.v1beta1.MsgCreateEntity", value: ixo.entity.v1beta1.MsgCreateEntity.fromPartial({ @@ -96,13 +124,7 @@ export const CreateEntity = async ( // }) // ), // since no groups at time of run adding creators keys as verification methods - verification: createIidVerificationMethods({ - did, - pubkey: myPubKey, - address: myAddress, - controller: did, - type: keyType, - }), + verification: verification, linkedResource: linkedResources.concat( entity.linkedResources.map((r) => ixo.iid.v1beta1.LinkedResource.fromPartial(r) diff --git a/__tests__/setup/constants.ts b/__tests__/setup/constants.ts index aa7f1fa0..df7675ba 100644 --- a/__tests__/setup/constants.ts +++ b/__tests__/setup/constants.ts @@ -5,6 +5,9 @@ export const dids = { assetClass: "", impactsDao: "", emergingDao: "", + cookstoveAssetProtocol: "", + prospectOracle: "", + scalnyxOracle: "", }; export type LinkedResourcesUploaded = { diff --git a/__tests__/setup/emerging/constants.ts b/__tests__/setup/emerging/constants.ts index 6f2d21b3..086f1fb2 100644 --- a/__tests__/setup/emerging/constants.ts +++ b/__tests__/setup/emerging/constants.ts @@ -141,7 +141,7 @@ export const setup_dao_constants = () => ({ export const setup_protocol_ver_claims_constants = () => ({ entity: { // type of entity eg dao/protocol/asset/oracle - entityType: "protocol", + entityType: "protocol/claims", // please use Impact DAO's did as relayerNode eg dids.impactsDao relayerNode: dids.emergingDao, // for context class below please use the parent dao/protocol/asset class did provided by ixo eg dids.daoClass @@ -277,7 +277,7 @@ export const setup_protocol_ver_claims_constants = () => ({ export const setup_protocol_cooking_constants = () => ({ entity: { // type of entity eg dao/protocol/asset/oracle - entityType: "protocol", + entityType: "protocol/claims", // please use Impact DAO's did as relayerNode eg dids.impactsDao relayerNode: dids.emergingDao, // for context class below please use the parent dao/protocol/asset class did provided by ixo eg dids.daoClass @@ -413,7 +413,7 @@ export const setup_protocol_cooking_constants = () => ({ export const setup_protocol_fuel_constants = () => ({ entity: { // type of entity eg dao/protocol/asset/oracle - entityType: "protocol", + entityType: "protocol/claims", // please use Impact DAO's did as relayerNode eg dids.impactsDao relayerNode: dids.emergingDao, // for context class below please use the parent dao/protocol/asset class did provided by ixo eg dids.daoClass diff --git a/__tests__/setup/emerging/setupFlow.ts b/__tests__/setup/emerging/setupFlow.ts index 65289b67..7d591079 100644 --- a/__tests__/setup/emerging/setupFlow.ts +++ b/__tests__/setup/emerging/setupFlow.ts @@ -14,8 +14,9 @@ import { setup_protocol_ver_claims_constants, } from "./constants"; import * as Entity from "../Entity"; +import * as Entity1 from "../../modules/Entity"; import { chainNetwork } from "../index.setup.spec"; -import { LinkedResourcesUploaded } from "../constants"; +import { LinkedResourcesUploaded, dids } from "../constants"; export const emergingDaoFlow = () => describe("Flow for creating a Entity (dao/protocol/oracle)", () => { @@ -111,7 +112,10 @@ export const emergingProtocolsFlow = () => // below test can fail as user might already be ledgered, that is ok beforeAll(() => - generateNewWallet(WalletUsers.tester, process.env.TESTER_MNEMONIC) + Promise.all([ + generateNewWallet(WalletUsers.tester, process.env.TESTER_MNEMONIC), + generateNewWallet(WalletUsers.alice, process.env.ED_KEYS_MNEMONIC), + ]) ); // @ts-ignore @@ -307,4 +311,22 @@ export const emergingProtocolsFlow = () => return res; }); // =============================== END + + // Create cookstove-asset-protocol + // ========================================= + let cookstoveAssetProtocolDid: string; + testMsg("/ixo.entity.v1beta1.MsgCreateEntity protocol", async () => { + const res = await Entity1.CreateEntity( + "protocol/asset", + [{ key: "class", val: dids.protocolClass }], + dids.emergingDao + ); + cookstoveAssetProtocolDid = utils.common.getValueFromEvents( + res, + "wasm", + "token_id" + ); + console.log({ cookstoveAssetProtocolDid }); + return res; + }); }); diff --git a/__tests__/setup/impacts/constants.ts b/__tests__/setup/impacts/constants.ts index ba55667e..dcc669cf 100644 --- a/__tests__/setup/impacts/constants.ts +++ b/__tests__/setup/impacts/constants.ts @@ -6,14 +6,15 @@ export const setup_dao_constants = () => ({ entity: { // type of entity eg dao/protocol/asset/oracle entityType: "dao", + // TODO DAO itself, determine deterministically // please use Impact DAO's did as relayerNode eg dids.impactsDao relayerNode: "", - // TODO create classes first as need dao class // for context class below please use the parent dao/protocol/asset class did provided by ixo eg dids.daoClass contextClass: dids.daoClass, // can add a also know ass if want alsoKnownAs: "", // you can remove/add more services + // TODO need own impacts cellnode service: [ { id: "{id}#cellnode", @@ -60,7 +61,7 @@ export const setup_dao_constants = () => ({ id: "IrCcJ8hl8t", type: "paragraph", data: { - text: "The Impact DAO cooperative makes outcomes-based investments into innovations, projects and ventures that can dleiver Internet of Impact solutions. Members of the DAO are pioneering innovators, investors, builders, and implementors who contribute capital, work, open-source software, and market access opportunities. The DAO treasury provides financing for the ecosystem by growing a portfolio of assets and by generating revenues from its investments. The DAO Tokens represent each member's participation share in the treasury that can be exchanged after the DAO breaks even. More recent investors recive a liquidation preference.", + text: "The Impact DAO cooperative makes outcomes-based investments into innovations, projects and ventures that can deliver Internet of Impact solutions. Members of the DAO are pioneering innovators, investors, builders, and implementors who contribute capital, work, open-source software, and market access opportunities. The DAO treasury provides financing for the ecosystem by growing a portfolio of assets and by generating revenues from its investments. The DAO Tokens represent each member's participation share in the treasury that can be exchanged after the DAO breaks even. More recent investors receive a liquidation preference.", }, }, }, @@ -80,7 +81,7 @@ export const setup_dao_constants = () => ({ ddoTags: [ { category: "dao", - tags: ["Market Relayer", "Rights"], + tags: ["Cooperative"], }, ], }, diff --git a/__tests__/setup/index.setup.spec.ts b/__tests__/setup/index.setup.spec.ts index 4962be1b..44c08ed9 100644 --- a/__tests__/setup/index.setup.spec.ts +++ b/__tests__/setup/index.setup.spec.ts @@ -26,9 +26,13 @@ impactsFlow(); // next create emerging dao to save did to ./constants.ts emergingDaoFlow(); -// next can create the other daos etc +// next create emerging protocols and save cookstoveAssetProtocol to ./constants.ts emergingProtocolsFlow(); -ecsFlow(); + +// next create daos and oracles and save oracles dids to ./constants.ts propectFlow(); scalnyxFlow(); + +// next can create the other daos etc +ecsFlow(); supamotoFlow(); diff --git a/__tests__/setup/prospect/constants.ts b/__tests__/setup/prospect/constants.ts index 7ebb5e11..3372d2cf 100644 --- a/__tests__/setup/prospect/constants.ts +++ b/__tests__/setup/prospect/constants.ts @@ -145,7 +145,7 @@ export const setup_dao_constants = () => ({ export const setup_oracle_constants = () => ({ entity: { // type of entity eg dao/protocol/asset/oracle - entityType: "oracle", + entityType: "oracle/evaluation", // please use Impact DAO's did as relayerNode eg dids.impactsDao relayerNode: dids.emergingDao, // for context class below please use the parent dao/protocol/asset class did provided by ixo eg dids.daoClass diff --git a/__tests__/setup/scalnyx/constants.ts b/__tests__/setup/scalnyx/constants.ts index ee56f716..65e11bf5 100644 --- a/__tests__/setup/scalnyx/constants.ts +++ b/__tests__/setup/scalnyx/constants.ts @@ -146,7 +146,7 @@ export const setup_dao_constants = () => ({ export const setup_oracle_constants = () => ({ entity: { // type of entity eg dao/protocol/asset/oracle - entityType: "oracle", + entityType: "oracle/evaluation", // please use Impact DAO's did as relayerNode eg dids.impactsDao relayerNode: dids.emergingDao, // for context class below please use the parent dao/protocol/asset class did provided by ixo eg dids.daoClass diff --git a/__tests__/setup/scalnyx/setupFlow.ts b/__tests__/setup/scalnyx/setupFlow.ts index 51ddfc0f..7ff9317c 100644 --- a/__tests__/setup/scalnyx/setupFlow.ts +++ b/__tests__/setup/scalnyx/setupFlow.ts @@ -20,7 +20,12 @@ export const scalnyxFlow = () => // below test can fail as user might already be ledgered, that is ok beforeAll(() => - generateNewWallet(WalletUsers.tester, process.env.TESTER_MNEMONIC) + beforeAll(() => + Promise.all([ + generateNewWallet(WalletUsers.tester, process.env.TESTER_MNEMONIC), + generateNewWallet(WalletUsers.alice, process.env.ED_KEYS_MNEMONIC), + ]) + ) ); // @ts-ignore diff --git a/__tests__/setup/supamoto/constants.ts b/__tests__/setup/supamoto/constants.ts index a1f1c7d4..5150a9b7 100644 --- a/__tests__/setup/supamoto/constants.ts +++ b/__tests__/setup/supamoto/constants.ts @@ -157,3 +157,34 @@ export const setup_dao_constants = () => ({ // Types for typescript strict type checking, please ignore export type SetupDaoConstantFields = ReturnType; + +export const cookstoveIds = [ + 202200001, 202200005, 202200007, 202200009, 202200010, 202200011, 202200012, + 202200013, 202200015, 202200016, 202200018, 202200020, 202200025, 202200028, + 202200034, 202200096, 202200099, 202200111, 202200189, 202200301, 202200309, + 202200372, 202200388, 310000004, 310000076, 310000095, 310000115, 310000163, + 310000205, 310000267, 310000341, 310000343, 310000405, 310000624, 310000745, + 310000749, 310000771, 310000774, 310000832, 310000879, 310001162, 310001224, + 310001353, 310001365, 310001421, 310001742, 310001813, 310001819, 310001856, + 310001864, 310001999, 310002006, 310002066, 310002108, 310002165, 310002195, + 310002214, 310002352, 310002365, 310002511, 310002578, 310002653, 310002766, + 310002768, 310002884, 310003024, 310003076, 310003080, 310003551, 310003633, + 310005726, 310007811, 310008327, 310008752, 310008928, 310008934, 310008961, + 310009369, 310009945, 310012706, 310013456, 310013483, 310014068, 310014791, + 310014870, 310014932, 310015802, 310015897, 310015928, 310016233, 310017019, + 310017126, 310017236, 310017478, 310017571, 310017700, 310018042, 310018331, + 310019032, 310019080, 310020612, 310020614, 310020762, 310020954, 310021047, + 310021108, 310021222, 310021223, 310021225, 310021338, 310021351, 310021358, + 310021407, 310021489, 310021816, 310021823, 310021918, 310021992, 310022093, + 310022125, 310022157, 310022158, 310022211, 310022219, 310022225, 310022273, + 310022288, 310022314, 310022421, 310022515, 310022697, 310022719, 310022784, + 310022811, 310022840, 310022888, 310022931, 310023055, 310023068, 310023074, + 310023118, 310023153, 310023212, 310023245, 310023283, 310023547, 310025085, + 310025198, 310025200, 310025233, 310025300, 310025325, 310025390, 310025398, + 310025409, 310025446, 310025570, 310028308, 310028764, 310029142, 310029182, + 310029369, 310029441, 310029811, 310029997, 310030266, 310030442, 310030721, + 310031447, 310032389, 310032587, 310032589, 310032590, 310032701, 310032952, + 310032962, 310032963, 310032969, 310032989, 310033438, 310033439, 310034102, + 310034281, 310035031, 310035220, 310035244, 310035247, 310035265, 310035385, + 310035508, 310036019, 310036122, 310036958, 310037403, 310038361, +]; diff --git a/__tests__/setup/supamoto/setupFlow.ts b/__tests__/setup/supamoto/setupFlow.ts index 147de310..a60ff448 100644 --- a/__tests__/setup/supamoto/setupFlow.ts +++ b/__tests__/setup/supamoto/setupFlow.ts @@ -1,16 +1,18 @@ import { customQueries, generateNewWallet, + getFileFromPath, sendFromFaucet, testMsg, utils, } from "../../helpers/common"; import { WalletUsers } from "../../helpers/constants"; import * as IidMain from "../../modules/Iid"; -import { setup_dao_constants } from "./constants"; +import { cookstoveIds, setup_dao_constants } from "./constants"; import * as Entity from "../Entity"; +import * as Entity1 from "../../modules/Entity"; import { chainNetwork } from "../index.setup.spec"; -import { LinkedResourcesUploaded } from "../constants"; +import { LinkedResourcesUploaded, dids } from "../constants"; export const supamotoFlow = () => describe("Flow for creating a Entity (dao/protocol/oracle)", () => { @@ -97,3 +99,311 @@ export const supamotoFlow = () => }); // =============================== END }); + +export const cookstovesFlow = () => + describe("Testing the Supamoto nfts flow", () => { + // =============================================================== + // Set Testers mnemonic to env variable and ledger root user did + // =============================================================== + + // below test can fail as user might already be ledgered, that is ok + beforeAll(() => + Promise.all([ + generateNewWallet(WalletUsers.tester, process.env.TESTER_MNEMONIC), + generateNewWallet(WalletUsers.alice, process.env.ED_KEYS_MNEMONIC), + ]) + ); + + // @ts-ignore + if (chainNetwork != "mainnet") { + // Send from faucet for devnet/testnet + sendFromFaucet(WalletUsers.tester); + } + testMsg("/ixo.iid.v1beta1.MsgCreateIidDocument", () => + IidMain.CreateIidDoc(WalletUsers.tester) + ); + + // =============================================================== + // Create all assets + // =============================================================== + + // Create top-level class dao + let daoDid = "did:ixo:entity:eaff254f2fc62aefca0d831bc7361c14"; + testMsg("/ixo.entity.v1beta1.MsgCreateEntity asset", async () => { + const res = await Entity1.CreateEntity("dao"); + daoDid = utils.common.getValueFromEvents(res, "wasm", "token_id"); + console.log({ daoDid }); + return res; + }); + + // Create dao entity which is credential issuer + let daoCredsIssuerDid = "did:ixo:entity:4d94f9b6078432648a755203eed50644"; + testMsg("/ixo.entity.v1beta1.MsgCreateEntity asset", async () => { + const res = await Entity1.CreateEntity("dao", [ + { key: "class", val: daoDid }, + ]); + daoCredsIssuerDid = utils.common.getValueFromEvents( + res, + "wasm", + "token_id" + ); + console.log({ daoCredsIssuerDid }); + return res; + }); + + // Save related images WEB3 + let supaLogo = + "https://bafkreifkl6w55nasgqid22d2cqyxccjktbciefzmiqvcudlq3eoer2mzhi.ipfs.w3s.link"; + let supaNftImage = + "https://bafkreideszg4fdha4tf7ldpecltxbyxbnapb663tkuksk2vcczkzkxppaa.ipfs.w3s.link"; + let ecsLogo = + "https://bafkreigkajsskkswn5jwcmfxhn3rqc7gevzgroacq7ygfz6mzkgo72ej4i.ipfs.w3s.link"; + test("Saving device creds", async () => { + supaLogo = ( + await customQueries.cellnode.uploadWeb3Doc( + utils.common.generateId(12), + "image/png", + getFileFromPath(["documents", "supamoto_logo.png"]), + undefined, + chainNetwork + ) + ).url; + console.log({ supaLogo }); + supaNftImage = ( + await customQueries.cellnode.uploadWeb3Doc( + utils.common.generateId(12), + "image/png", + getFileFromPath(["documents", "supamoto-nft-image.png"]), + undefined, + chainNetwork + ) + ).url; + console.log({ supaNftImage }); + ecsLogo = ( + await customQueries.cellnode.uploadWeb3Doc( + utils.common.generateId(12), + "image/png", + getFileFromPath(["documents", "ecs_logo_flame only.png"]), + undefined, + chainNetwork + ) + ).url; + console.log({ ecsLogo }); + expect(ecsLogo).toBeTruthy(); + }); + + // Save supamoto credsPdf WEB3 + let projectCertDoc = + "bafkreiefafy2u5df4l52yb7vvz32hxrxhcceyaq3z7xww2qlz2fp3ppeum"; + test("Saving projectCertDoc", async () => { + projectCertDoc = ( + await customQueries.cellnode.uploadWeb3Doc( + utils.common.generateId(12), + "application/pdf", + getFileFromPath([ + "documents", + "MimiMoto report Aprovecho Research Center March 2017.pdf", + ]), + undefined, + chainNetwork + ) + ).cid; + console.log({ projectCertDoc }); + expect(projectCertDoc).toBeTruthy(); + }); + + // Save supamoto profile WEB3 + let profile = "4kavdefz12wlefltwxr"; + test("Saving profile", async () => { + const file = JSON.parse( + getFileFromPath(["documents", "test-supamoto-profile.jsonld"], "ascii") + ); + file["image"] = supaNftImage; + file["logo"] = supaLogo; + let buff = Buffer.from(JSON.stringify(file)); + profile = ( + await customQueries.cellnode.uploadPublicDoc( + "application/ld+json", + buff.toString("base64"), + undefined, + chainNetwork + ) + ).key; + console.log({ profile }); + expect(profile).toBeTruthy(); + }); + + // Save supamoto projectCreds WEB3 + let projectCreds = + "bafkreih2oq64xhbgp7vyarcrgw6dcofms4zdmjqms6vnfx32vzwglj6nd4"; + test("Saving projectCert", async () => { + const file = JSON.parse( + getFileFromPath( + ["documents", "test-supamoto-projectCredential.jsonld"], + "ascii" + ) + ); + file["issuer"] = daoCredsIssuerDid; + file["credentialSubject"]["project"]["linkedResources"] = file[ + "credentialSubject" + ]["project"]["linkedResources"].map((lr: any) => ({ + ...lr, + id: `https://ipfs.io/ipfs/${projectCertDoc}`, + proof: projectCertDoc, + })); + let buff = Buffer.from(JSON.stringify(file)); + projectCreds = ( + await customQueries.cellnode.uploadWeb3Doc( + utils.common.generateId(12), + "application/ld+json", + buff.toString("base64"), + undefined, + chainNetwork + ) + ).cid; + console.log({ projectCreds }); + expect(projectCreds).toBeTruthy(); + }); + + // Save supamoto tags CELLNODE + let tags = "klfh2wqlw9mleflu0u6"; + test("Saving tags", async () => { + tags = ( + await customQueries.cellnode.uploadPublicDoc( + "application/ld+json", + getFileFromPath(["documents", "test-supamoto-tags.jsonld"]), + undefined, + chainNetwork + ) + ).key; + console.log({ tags }); + expect(tags).toBeTruthy(); + }); + + // Save supamoto tokenMetadata WEB3 emerging account + let tokenMetadata = + "bafkreie7kbpppoizx7anxxufblfkdfmuy27mppuz2hq4a4uouudweb2sm4"; + test("Saving tokenMetadata", async () => { + const file = JSON.parse( + getFileFromPath( + ["documents", "test-supamoto-token-metadata.json"], + "ascii" + ) + ); + file["image"] = supaLogo; + file["properties"]["icon"] = supaLogo; + let buff = Buffer.from(JSON.stringify(file)); + tokenMetadata = ( + await customQueries.cellnode.uploadWeb3Doc( + utils.common.generateId(12), + "application/ld+json", + buff.toString("base64"), + undefined, + chainNetwork + ) + ).cid; + console.log({ tokenMetadata }); + expect(tokenMetadata).toBeTruthy(); + }); + + // TODO need protocol to add as template id + // Save supamoto claims CELLNODE + let claims = "gf9m2u5ds6tleflu4a8"; + test("Saving claims", async () => { + claims = ( + await customQueries.cellnode.uploadPublicDoc( + "application/ld+json", + getFileFromPath(["documents", "test-supamoto-claims.jsonld"]), + undefined, + chainNetwork + ) + ).key; + console.log({ claims }); + expect(claims).toBeTruthy(); + }); + + // supamoto-asset-collection + let assetCollectionDid: string; + testMsg("/ixo.entity.v1beta1.MsgCreateEntity asset class", async () => { + const res = await Entity1.CreateEntityAssetSupamoto({ + inheritEntityDid: dids.cookstoveAssetProtocol, + profile, + // page, + // creator, + // administrator, + tags, + claims, + tokenMetadata, + projectCert: projectCreds, + oracles: [dids.prospectOracle, dids.scalnyxOracle], + relayerDid: dids.emergingDao, + }); + assetCollectionDid = utils.common.getValueFromEvents( + res, + "wasm", + "token_id" + ); + console.log({ assetCollectionDid }); + return res; + }); + + // Create a batch of Asset entities for the individual Supamoto assets + let assetInstanceDids: string[] = []; + + cookstoveIds.map((id, i) => + testMsg( + `/ixo.entity.v1beta1.MsgCreateEntity asset instance index:${ + i + 1 + } for id:${id}`, + async () => { + let deviceCreds: string; + const file = JSON.parse( + getFileFromPath( + ["documents", "test-supamoto-device-credential.jsonld"], + "ascii" + ) + ); + file["issuer"] = daoCredsIssuerDid; + file["credentialSubject"]["id"] = ( + file["credentialSubject"]["id"] as string + ).replace("deviceId", id.toString()); + file["credentialSubject"]["certification"][ + "id" + ] = `https://ipfs.io/ipfs/${projectCertDoc}`; + let buff = Buffer.from(JSON.stringify(file)); + deviceCreds = ( + await customQueries.cellnode.uploadWeb3Doc( + utils.common.generateId(12), + "application/ld+json", + buff.toString("base64"), + undefined, + chainNetwork + ) + ).cid; + + console.log({ deviceCreds }); + if (!deviceCreds) throw new Error("error saving device creds file"); + + const res = await Entity1.CreateEntityAssetSupamotoInstance( + assetCollectionDid, + id, + i + 1, + deviceCreds, + dids.emergingDao + ); + const nftAssetDid = utils.common.getValueFromEvents( + res, + "wasm", + "token_id" + ); + console.log({ nftAssetDid }); + assetInstanceDids.push(nftAssetDid); + return res; + } + ) + ); + test("Logging all nft assets created", async () => { + console.log({ assetInstanceDids }); + expect(true).toBeTruthy(); + }); + }); diff --git a/src/custom_queries/contract.constants.ts b/src/custom_queries/contract.constants.ts index 6681035d..c317699b 100644 --- a/src/custom_queries/contract.constants.ts +++ b/src/custom_queries/contract.constants.ts @@ -3,162 +3,162 @@ export const contracts = [ name: "cw721", path: ["contracts", "ixo", "cw721.wasm"], category: "ixo", - code: { devnet: 1, testnet: 1 }, + code: { devnet: 1, testnet: 1, mainnet: 1 }, }, { name: "ixo1155", path: ["contracts", "ixo", "ixo1155.wasm"], category: "ixo", - code: { devnet: 2, testnet: 2 }, + code: { devnet: 2, testnet: 2, mainnet: 2 }, }, { name: "dao_core", path: ["contracts", "daodao", "dao_core.wasm"], category: "daodao", - code: { devnet: 3, testnet: 3 }, + code: { devnet: 3, testnet: 3, mainnet: 3 }, }, { name: "cw_admin_factory", path: ["contracts", "daodao", "cw_admin_factory.wasm"], category: "daodao", - code: { devnet: 4, testnet: 4 }, + code: { devnet: 4, testnet: 4, mainnet: 4 }, }, { name: "cw_fund_distributor", path: ["contracts", "daodao", "cw_fund_distributor.wasm"], category: "daodao", - code: { devnet: 5, testnet: 5 }, + code: { devnet: 5, testnet: 5, mainnet: 5 }, }, { name: "cw_payroll_factory", path: ["contracts", "daodao", "cw_payroll_factory.wasm"], category: "daodao", - code: { devnet: 6, testnet: 6 }, + code: { devnet: 6, testnet: 6, mainnet: 6 }, }, { name: "cw_token_swap", path: ["contracts", "daodao", "cw_token_swap.wasm"], category: "daodao", - code: { devnet: 7, testnet: 7 }, + code: { devnet: 7, testnet: 7, mainnet: 7 }, }, { name: "cw_vesting", path: ["contracts", "daodao", "cw_vesting.wasm"], category: "daodao", - code: { devnet: 8, testnet: 8 }, + code: { devnet: 8, testnet: 8, mainnet: 8 }, }, { name: "dao_migrator", path: ["contracts", "daodao", "dao_migrator.wasm"], category: "daodao", - code: { devnet: 9, testnet: 9 }, + code: { devnet: 9, testnet: 9, mainnet: 9 }, }, { name: "dao_pre_propose_approval_single", path: ["contracts", "daodao", "dao_pre_propose_approval_single.wasm"], category: "daodao", - code: { devnet: 10, testnet: 10 }, + code: { devnet: 10, testnet: 10, mainnet: 10 }, }, { name: "dao_pre_propose_approver", path: ["contracts", "daodao", "dao_pre_propose_approver.wasm"], category: "daodao", - code: { devnet: 11, testnet: 11 }, + code: { devnet: 11, testnet: 11, mainnet: 11 }, }, { name: "dao_pre_propose_multiple", path: ["contracts", "daodao", "dao_pre_propose_multiple.wasm"], category: "daodao", - code: { devnet: 12, testnet: 12 }, + code: { devnet: 12, testnet: 12, mainnet: 12 }, }, { name: "dao_pre_propose_single", path: ["contracts", "daodao", "dao_pre_propose_single.wasm"], category: "daodao", - code: { devnet: 13, testnet: 13 }, + code: { devnet: 13, testnet: 13, mainnet: 13 }, }, { name: "dao_proposal_condorcet", path: ["contracts", "daodao", "dao_proposal_condorcet.wasm"], category: "daodao", - code: { devnet: 14, testnet: 14 }, + code: { devnet: 14, testnet: 14, mainnet: 14 }, }, { name: "dao_proposal_multiple", path: ["contracts", "daodao", "dao_proposal_multiple.wasm"], category: "daodao", - code: { devnet: 15, testnet: 15 }, + code: { devnet: 15, testnet: 15, mainnet: 15 }, }, { name: "dao_proposal_single", path: ["contracts", "daodao", "dao_proposal_single.wasm"], category: "daodao", - code: { devnet: 16, testnet: 16 }, + code: { devnet: 16, testnet: 16, mainnet: 16 }, }, { name: "cw20_stake", path: ["contracts", "daodao", "cw20_stake.wasm"], category: "daodao", - code: { devnet: 17, testnet: 17 }, + code: { devnet: 17, testnet: 17, mainnet: 17 }, }, { name: "cw20_stake_external_rewards", path: ["contracts", "daodao", "cw20_stake_external_rewards.wasm"], category: "daodao", - code: { devnet: 18, testnet: 18 }, + code: { devnet: 18, testnet: 18, mainnet: 18 }, }, { name: "cw20_stake_reward_distributor", path: ["contracts", "daodao", "cw20_stake_reward_distributor.wasm"], category: "daodao", - code: { devnet: 19, testnet: 19 }, + code: { devnet: 19, testnet: 19, mainnet: 19 }, }, { name: "dao_voting_cw4", path: ["contracts", "daodao", "dao_voting_cw4.wasm"], category: "daodao", - code: { devnet: 20, testnet: 20 }, + code: { devnet: 20, testnet: 20, mainnet: 20 }, }, { name: "dao_voting_cw20_staked", path: ["contracts", "daodao", "dao_voting_cw20_staked.wasm"], category: "daodao", - code: { devnet: 21, testnet: 21 }, + code: { devnet: 21, testnet: 21, mainnet: 21 }, }, { name: "dao_voting_cw721_staked", path: ["contracts", "daodao", "dao_voting_cw721_staked.wasm"], category: "daodao", - code: { devnet: 22, testnet: 22 }, + code: { devnet: 22, testnet: 22, mainnet: 22 }, }, { name: "dao_voting_native_staked", path: ["contracts", "daodao", "dao_voting_native_staked.wasm"], category: "daodao", - code: { devnet: 23, testnet: 23 }, + code: { devnet: 23, testnet: 23, mainnet: 23 }, }, { name: "cw4_group", path: ["contracts", "cosmwasm", "cw4_group.wasm"], category: "daodao", - code: { devnet: 24, testnet: 24 }, + code: { devnet: 24, testnet: 24, mainnet: 24 }, }, { name: "cw20_base", path: ["contracts", "cosmwasm", "cw20_base.wasm"], category: "daodao", - code: { devnet: 25, testnet: 25 }, + code: { devnet: 25, testnet: 25, mainnet: 25 }, }, { name: "cw721_base", path: ["contracts", "cosmwasm", "cw721_base.wasm"], category: "daodao", - code: { devnet: 26, testnet: 26 }, + code: { devnet: 26, testnet: 26, mainnet: 26 }, }, { name: "wasmswap", path: ["contracts", "wasmswap", "wasmswap.wasm"], category: "daodao", - code: { devnet: 27, testnet: 27 }, + code: { devnet: 27, testnet: 27, mainnet: 27 }, }, ]; diff --git a/src/stargate_client/customRegistries.ts b/src/stargate_client/customRegistries.ts index 3b5ba6eb..15856606 100644 --- a/src/stargate_client/customRegistries.ts +++ b/src/stargate_client/customRegistries.ts @@ -2,6 +2,9 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; import { ixo, cosmwasm, cosmos, ibc, ica } from "../codegen"; export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ + // tx + ["/cosmos.tx.v1beta1.Tx", cosmos.tx.v1beta1.Tx], + // base ["/cosmos.base.v1beta1.Coin", cosmos.base.v1beta1.Coin],