@magic-ext/algorand
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -1,2 +0,106 @@ | ||
var r,t=require("@magic-sdk/commons");function n(r,t){return(n=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r})(r,t)}!function(r){r.AlgorandSignTransaction="algod_signTransaction",r.AlgorandSignBid="algod_signBid",r.AlgorandGetWallet="algod_getWallet",r.AlgorandSignGroupTransaction="algod_signGroupTransaction"}(r||(r={})),exports.AlgorandExtension=function(t){var e,o;function i(r){var n;return(n=t.call(this)||this).algorandConfig=void 0,n.name="algod",n.config={},n.algorandConfig=r,n.config={rpcUrl:r.rpcUrl,chainType:"ALOGD"},n}o=t,(e=i).prototype=Object.create(o.prototype),e.prototype.constructor=e,n(e,o);var a=i.prototype;return a.signTransaction=function(t){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(r.AlgorandSignTransaction,t)))}catch(r){return Promise.reject(r)}},a.signBid=function(t){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(r.AlgorandSignBid,t)))}catch(r){return Promise.reject(r)}},a.getWallet=function(){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(r.AlgorandGetWallet,[])))}catch(r){return Promise.reject(r)}},a.signGroupTransaction=function(t){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(r.AlgorandSignGroupTransaction,t)))}catch(r){return Promise.reject(r)}},i}(t.Extension.Internal); | ||
//# sourceMappingURL=index.js.map | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AlgorandExtension = void 0; | ||
var magic_sdk_1 = require("magic-sdk"); | ||
var types_1 = require("./types"); | ||
var AlgorandExtension = /** @class */ (function (_super) { | ||
__extends(AlgorandExtension, _super); | ||
function AlgorandExtension(algorandConfig) { | ||
var _this = _super.call(this) || this; | ||
_this.algorandConfig = algorandConfig; | ||
_this.name = 'algod'; | ||
_this.config = {}; | ||
_this.config = { | ||
rpcUrl: algorandConfig.rpcUrl, | ||
chainType: 'ALOGD', | ||
}; | ||
return _this; | ||
} | ||
AlgorandExtension.prototype.signTransaction = function (txn) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(types_1.AlgorandPayloadMethod.AlgorandSignTransaction, txn))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.signBid = function (txn) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(types_1.AlgorandPayloadMethod.AlgorandSignBid, txn))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.getWallet = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(types_1.AlgorandPayloadMethod.AlgorandGetWallet, []))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.signGroupTransaction = function (txns) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(types_1.AlgorandPayloadMethod.AlgorandSignGroupTransaction, txns))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.signGroupTransactionV2 = function (txns) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(types_1.AlgorandPayloadMethod.AlgorandSignGroupTransactionV2, txns))]; | ||
}); | ||
}); | ||
}; | ||
return AlgorandExtension; | ||
}(magic_sdk_1.Extension.Internal)); | ||
exports.AlgorandExtension = AlgorandExtension; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,103 @@ | ||
import{Extension as r}from"@magic-sdk/commons";function t(r,e){return(t=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r})(r,e)}var e;!function(r){r.AlgorandSignTransaction="algod_signTransaction",r.AlgorandSignBid="algod_signBid",r.AlgorandGetWallet="algod_getWallet",r.AlgorandSignGroupTransaction="algod_signGroupTransaction"}(e||(e={}));var n=function(r){var n,o;function a(t){var e;return(e=r.call(this)||this).algorandConfig=void 0,e.name="algod",e.config={},e.algorandConfig=t,e.config={rpcUrl:t.rpcUrl,chainType:"ALOGD"},e}o=r,(n=a).prototype=Object.create(o.prototype),n.prototype.constructor=n,t(n,o);var i=a.prototype;return i.signTransaction=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(e.AlgorandSignTransaction,r)))}catch(r){return Promise.reject(r)}},i.signBid=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(e.AlgorandSignBid,r)))}catch(r){return Promise.reject(r)}},i.getWallet=function(){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(e.AlgorandGetWallet,[])))}catch(r){return Promise.reject(r)}},i.signGroupTransaction=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(e.AlgorandSignGroupTransaction,r)))}catch(r){return Promise.reject(r)}},a}(r.Internal);export{n as AlgorandExtension}; | ||
//# sourceMappingURL=index.js.map | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
import { Extension } from 'magic-sdk'; | ||
import { AlgorandPayloadMethod } from './types'; | ||
var AlgorandExtension = /** @class */ (function (_super) { | ||
__extends(AlgorandExtension, _super); | ||
function AlgorandExtension(algorandConfig) { | ||
var _this = _super.call(this) || this; | ||
_this.algorandConfig = algorandConfig; | ||
_this.name = 'algod'; | ||
_this.config = {}; | ||
_this.config = { | ||
rpcUrl: algorandConfig.rpcUrl, | ||
chainType: 'ALOGD', | ||
}; | ||
return _this; | ||
} | ||
AlgorandExtension.prototype.signTransaction = function (txn) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(AlgorandPayloadMethod.AlgorandSignTransaction, txn))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.signBid = function (txn) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(AlgorandPayloadMethod.AlgorandSignBid, txn))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.getWallet = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(AlgorandPayloadMethod.AlgorandGetWallet, []))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.signGroupTransaction = function (txns) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(AlgorandPayloadMethod.AlgorandSignGroupTransaction, txns))]; | ||
}); | ||
}); | ||
}; | ||
AlgorandExtension.prototype.signGroupTransactionV2 = function (txns) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(AlgorandPayloadMethod.AlgorandSignGroupTransactionV2, txns))]; | ||
}); | ||
}); | ||
}; | ||
return AlgorandExtension; | ||
}(Extension.Internal)); | ||
export { AlgorandExtension }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
var MagicAlgorandExtension=function(t){function r(t,n){return(r=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t})(t,n)}var n;return function(t){t.AlgorandSignTransaction="algod_signTransaction",t.AlgorandSignBid="algod_signBid",t.AlgorandGetWallet="algod_getWallet",t.AlgorandSignGroupTransaction="algod_signGroupTransaction"}(n||(n={})),function(t){var e,o;function a(r){var n;return(n=t.call(this)||this).algorandConfig=void 0,n.name="algod",n.config={},n.algorandConfig=r,n.config={rpcUrl:r.rpcUrl,chainType:"ALOGD"},n}o=t,(e=a).prototype=Object.create(o.prototype),e.prototype.constructor=e,r(e,o);var i=a.prototype;return i.signTransaction=function(t){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(n.AlgorandSignTransaction,t)))}catch(t){return Promise.reject(t)}},i.signBid=function(t){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(n.AlgorandSignBid,t)))}catch(t){return Promise.reject(t)}},i.getWallet=function(){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(n.AlgorandGetWallet,[])))}catch(t){return Promise.reject(t)}},i.signGroupTransaction=function(t){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(n.AlgorandSignGroupTransaction,t)))}catch(t){return Promise.reject(t)}},a}(t.Extension.Internal)}(Magic); | ||
var MagicAlgorandExtension=function(r){var t;return function(r){r.AlgorandSignTransaction="algod_signTransaction",r.AlgorandSignBid="algod_signBid",r.AlgorandGetWallet="algod_getWallet",r.AlgorandSignGroupTransaction="algod_signGroupTransaction",r.AlgorandSignGroupTransactionV2="algod_signGroupTransactionV2"}(t||(t={})),function(r){var n,e;function o(t){var n;return(n=r.call(this)||this).algorandConfig=t,n.name="algod",n.config={},n.config={rpcUrl:t.rpcUrl,chainType:"ALOGD"},n}e=r,(n=o).prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e;var a=o.prototype;return a.signTransaction=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(t.AlgorandSignTransaction,r)))}catch(r){return Promise.reject(r)}},a.signBid=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(t.AlgorandSignBid,r)))}catch(r){return Promise.reject(r)}},a.getWallet=function(){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(t.AlgorandGetWallet,[])))}catch(r){return Promise.reject(r)}},a.signGroupTransaction=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(t.AlgorandSignGroupTransaction,r)))}catch(r){return Promise.reject(r)}},a.signGroupTransactionV2=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(t.AlgorandSignGroupTransactionV2,r)))}catch(r){return Promise.reject(r)}},o}(r.Extension.Internal)}(Magic); |
{ | ||
"name": "@magic-ext/algorand", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "magic algorand extension", | ||
"author": "Magic <team@magic.link> (https://magic.link/)", | ||
"author": "Magic <hello@magic.link> (https://magic.link/)", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/magiclabs/magic-js" | ||
"url": "https://github.com/fortmatic/magic-sdk-extensions" | ||
}, | ||
"files": [ | ||
"dist" | ||
"dist/**/*.js", | ||
"dist/**/*.js.map", | ||
"dist/**/*.d.ts" | ||
], | ||
"target": "web", | ||
"cdnGlobalName": "MagicAlgorandExtension", | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/es/index.js", | ||
"types": "./dist/types/index.d.ts", | ||
"jsdelivr": "./dist/extension.js", | ||
"react-native": "./dist/react-native/index.native.js", | ||
"exports": { | ||
"import": "./dist/modern/index.mjs", | ||
"require": "./dist/cjs/index.js" | ||
"umdGlobal": "MagicAlgorandExtension", | ||
"main": "dist/cjs/index.js", | ||
"umd:main": "dist/extension.js", | ||
"jsdelivr": "dist/extension.js", | ||
"module": "dist/es/index.js", | ||
"types": "dist/cjs/index.d.ts", | ||
"devDependencies": { | ||
"magic-sdk": "^2.6.0" | ||
}, | ||
"externals": { | ||
"include": [ | ||
"@magic-sdk/commons" | ||
"ava": { | ||
"require": [ | ||
"ts-node/register", | ||
"./test/setup.ts" | ||
], | ||
"files": [ | ||
"test/**/*.spec.ts" | ||
], | ||
"extensions": [ | ||
"ts" | ||
], | ||
"verbose": true | ||
}, | ||
"nyc": { | ||
"extends": "@istanbuljs/nyc-config-typescript", | ||
"all": false, | ||
"check-coverage": true, | ||
"per-file": true, | ||
"lines": 99, | ||
"statements": 99, | ||
"functions": 99, | ||
"branches": 99, | ||
"reporter": [ | ||
"lcov" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@magic-sdk/commons": "^3.0.0" | ||
}, | ||
"gitHead": "a85f41892cbd7985ee1743764f7f905b89004eaa" | ||
} | ||
} |
@@ -50,3 +50,3 @@ # Magic Extension Algorand Blockchain | ||
By passing txnObj instance to `magic.algorand.signTransaction()` method, it will automatically sign the transaction with current user and | ||
generate transaction object including signature. | ||
generate transaction object including signature. | ||
```js | ||
@@ -72,3 +72,3 @@ const txn = { | ||
By passing txnObj instance to `magic.algorand.signBid()` method, it will automatically sign the bid with current user and | ||
generate transaction object including signature. | ||
generate transaction object including signature. | ||
```js | ||
@@ -88,1 +88,2 @@ const bid = { | ||
``` | ||
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
23283
21
297
1
1