forked from warp-contracts/warp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] Failed to retrieve the stamp contract status from arweave.net. w…
- Loading branch information
1 parent
c1c8824
commit f1cda73
Showing
5 changed files
with
97 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* eslint-disable */ | ||
import Arweave from 'arweave'; | ||
import { | ||
ArweaveGatewayBundledContractDefinitionLoader, | ||
ArweaveGatewayBundledInteractionLoader, | ||
defaultCacheOptions, | ||
WarpFactory | ||
} from '../src'; | ||
|
||
const arweave = Arweave.init({ | ||
host: 'arweave.net', | ||
port: 443, | ||
protocol: 'https', | ||
timeout: 200000 | ||
}); | ||
|
||
const arContractLoader = new ArweaveGatewayBundledContractDefinitionLoader('mainnet'); | ||
const arInteractionLoader = new ArweaveGatewayBundledInteractionLoader(arweave, 'mainnet'); | ||
const contractId = 'TlqASNDLA1Uh8yFiH-BzR_1FDag4s735F3PoUFEv2Mo'; | ||
const warp = WarpFactory.custom( | ||
arweave, | ||
{ | ||
...defaultCacheOptions, | ||
inMemory: true | ||
}, | ||
'mainnet' | ||
) | ||
.useArweaveGateway() | ||
.setInteractionsLoader(arInteractionLoader) | ||
.setDefinitionLoader(arContractLoader) | ||
.build(); | ||
|
||
const c = warp.contract(contractId).setEvaluationOptions({ | ||
allowBigInt: true, | ||
unsafeClient: 'skip' | ||
}); | ||
|
||
async function getState() { | ||
try { | ||
const { sortKey, cachedValue } = await c.readState(); | ||
console.log(sortKey, cachedValue.errorMessages, cachedValue.state, cachedValue.validity); | ||
} catch (error) { | ||
console.log('readState error:', error, 'contractId:', contractId); | ||
} | ||
} | ||
|
||
getState(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const Arweave = require("arweave"); | ||
|
||
const arweave = Arweave.init({ | ||
host: "arweave.net", | ||
port: 443, | ||
protocol: "https", | ||
}); | ||
const wallet = arweave.wallets.generate() | ||
.then(w => { | ||
arweave.wallets.jwkToAddress(w).then((address) => { | ||
console.log(address); | ||
//1seRanklLU_1VTGkEk7P0xAwMJfA7owA1JHW5KyZKlY | ||
}); | ||
}); |