@buildonspark/spark-sdk 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/chunk-AVI5E5VT.js +66 -0
- package/dist/{chunk-U7LRIWTF.js → chunk-GUZ3WCB4.js} +313 -143
- package/dist/{client-C88GCTPB.d.cts → client-CusuvuCe.d.cts} +2 -2
- package/dist/{client-Dg6vS_2I.d.ts → client-Dn4Ld8pD.d.ts} +2 -2
- package/dist/debug.cjs +452 -286
- package/dist/debug.d.cts +8 -6
- package/dist/debug.d.ts +8 -6
- package/dist/debug.js +1 -1
- package/dist/graphql/objects/index.d.cts +3 -3
- package/dist/graphql/objects/index.d.ts +3 -3
- package/dist/index.cjs +526 -303
- package/dist/index.d.cts +19 -187
- package/dist/index.d.ts +19 -187
- package/dist/index.js +11 -6
- package/dist/index.node.cjs +451 -328
- package/dist/index.node.d.cts +7 -6
- package/dist/index.node.d.ts +7 -6
- package/dist/index.node.js +55 -98
- package/dist/native/index.cjs +468 -301
- package/dist/native/index.d.cts +37 -18
- package/dist/native/index.d.ts +37 -18
- package/dist/native/index.js +317 -148
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark_token.d.cts +1 -1
- package/dist/proto/spark_token.d.ts +1 -1
- package/dist/{spark-ESAfZARg.d.cts → spark-Cj4brrP5.d.cts} +1 -1
- package/dist/{spark-ESAfZARg.d.ts → spark-Cj4brrP5.d.ts} +1 -1
- package/dist/{spark-wallet-B2WwKN8W.d.ts → spark-wallet-B6YthxDI.d.ts} +36 -17
- package/dist/{spark-wallet-Di65w0Us.d.cts → spark-wallet-BbOf2P2l.d.cts} +36 -17
- package/dist/spark-wallet.node-BBk1sGS2.d.cts +12 -0
- package/dist/spark-wallet.node-Bffethig.d.ts +12 -0
- package/dist/tests/test-utils.cjs +78 -50
- package/dist/tests/test-utils.d.cts +24 -23
- package/dist/tests/test-utils.d.ts +24 -23
- package/dist/tests/test-utils.js +2 -2
- package/dist/token-transactions-0_5XMWjs.d.ts +184 -0
- package/dist/token-transactions-CD-Adb5y.d.cts +184 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{xchain-address-CqRu3F21.d.cts → xchain-address-BnKZ0-dY.d.cts} +5 -5
- package/dist/{xchain-address-BsveIy5l.d.ts → xchain-address-Di3lu4Wy.d.ts} +5 -5
- package/package.json +7 -2
- package/src/index.node.ts +5 -1
- package/src/index.ts +4 -1
- package/src/services/config.ts +13 -2
- package/src/services/token-transactions.ts +22 -8
- package/src/services/wallet-config.ts +22 -13
- package/src/spark-wallet/spark-wallet.browser.ts +72 -0
- package/src/spark-wallet/spark-wallet.node.ts +60 -118
- package/src/spark-wallet/spark-wallet.ts +273 -146
- package/src/tests/integration/ssp/coop-exit-validation.test.ts +233 -0
- package/src/tests/integration/ssp/coop-exit.test.ts +112 -93
- package/src/tests/integration/ssp/static-deposit-validation.test.ts +145 -0
- package/src/tests/integration/ssp/static_deposit.test.ts +439 -132
- package/src/tests/integration/ssp/transfers.test.ts +7 -2
- package/src/tests/integration/static_deposit.test.ts +92 -0
- package/src/tests/integration/transfer.test.ts +1 -1
- package/src/tests/utils/regtest-test-faucet.ts +8 -0
- package/src/tests/utils/spark-testing-wallet.ts +42 -0
- package/src/tests/utils/test-faucet.ts +6 -2
- package/src/utils/token-identifier.ts +47 -4
- package/src/utils/token-transactions.ts +13 -9
- package/dist/chunk-LQZL2D3Y.js +0 -7
- package/dist/spark-wallet.node-7R0Rxyj9.d.cts +0 -13
- package/dist/spark-wallet.node-CSPWOWRu.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @buildonspark/spark-sdk
|
|
2
2
|
|
|
3
|
+
## 0.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- -- Opentelemetry improvements
|
|
8
|
+
-- Utility function to decode bech32mtokenidentifiers to raw token identifiers
|
|
9
|
+
-- Add userRequest to transfer in getTransfer() if it exists
|
|
10
|
+
-- Fixes to getIssuerTokenIdentifier() types
|
|
11
|
+
-- Migrates some internal filtering logic to key on token identifiers
|
|
12
|
+
-- Testing improvements
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @buildonspark/lrc20-sdk@0.0.61
|
|
15
|
+
|
|
3
16
|
## 0.2.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SparkWallet,
|
|
3
|
+
setCrypto
|
|
4
|
+
} from "./chunk-GUZ3WCB4.js";
|
|
5
|
+
|
|
6
|
+
// src/spark-wallet/spark-wallet.browser.ts
|
|
7
|
+
import {
|
|
8
|
+
WebTracerProvider
|
|
9
|
+
} from "@opentelemetry/sdk-trace-web";
|
|
10
|
+
import { registerInstrumentations } from "@opentelemetry/instrumentation";
|
|
11
|
+
import { FetchInstrumentation } from "@opentelemetry/instrumentation-fetch";
|
|
12
|
+
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
13
|
+
import { propagation } from "@opentelemetry/api";
|
|
14
|
+
var SparkWalletBrowser = class _SparkWalletBrowser extends SparkWallet {
|
|
15
|
+
static async initialize({
|
|
16
|
+
mnemonicOrSeed,
|
|
17
|
+
accountNumber,
|
|
18
|
+
signer,
|
|
19
|
+
options
|
|
20
|
+
}) {
|
|
21
|
+
const wallet = new _SparkWalletBrowser(options, signer);
|
|
22
|
+
wallet.initializeTracer(wallet);
|
|
23
|
+
const initResponse = await wallet.initWallet(mnemonicOrSeed, accountNumber);
|
|
24
|
+
return {
|
|
25
|
+
wallet,
|
|
26
|
+
...initResponse
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
initializeTracerEnv({
|
|
30
|
+
spanProcessors,
|
|
31
|
+
traceUrls
|
|
32
|
+
}) {
|
|
33
|
+
initializeTracerEnvBrowser({ spanProcessors, traceUrls });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function initializeTracerEnvBrowser({
|
|
37
|
+
spanProcessors,
|
|
38
|
+
traceUrls
|
|
39
|
+
}) {
|
|
40
|
+
const provider = new WebTracerProvider({ spanProcessors });
|
|
41
|
+
provider.register();
|
|
42
|
+
propagation.setGlobalPropagator(new W3CTraceContextPropagator());
|
|
43
|
+
registerInstrumentations({
|
|
44
|
+
instrumentations: [
|
|
45
|
+
new FetchInstrumentation({
|
|
46
|
+
ignoreUrls: [
|
|
47
|
+
/* Since we're wrapping global fetch we should be careful to avoid
|
|
48
|
+
adding headers for unrelated requests */
|
|
49
|
+
new RegExp(
|
|
50
|
+
`^(?!(${traceUrls.map((p) => p.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")}))`
|
|
51
|
+
)
|
|
52
|
+
],
|
|
53
|
+
propagateTraceHeaderCorsUrls: /.*/
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/index.ts
|
|
60
|
+
var cryptoImpl = typeof window !== "undefined" && window.crypto ? window.crypto : typeof global !== "undefined" && global.crypto ? global.crypto : null;
|
|
61
|
+
setCrypto(cryptoImpl);
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
SparkWalletBrowser,
|
|
65
|
+
initializeTracerEnvBrowser
|
|
66
|
+
};
|